<template>
    <div class="recommend">
      <div class="recommend-title">热销推荐</div>
      <ul>
        <router-link tag="li" :to="'/detail/' + item.id" class="recommend-item border-bottom" v-for="item in recommendList" :key="item.id">
          <div class="item-img-wrapper">
            <img class="item-img" :src="item.imgUrl" alt="">
          </div>
          <div class="item-info">
            <p class="item-title">{{item.title}}</p>
            <p class="item-desc">{{item.desc}}</p>
            <button class="item-button">查看详情</button>
          </div>
        </router-link>
      </ul>
    </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  },
  data () {
    return {}
  }
}
</script>

<style lang="stylus" scoped>
  @import "~css/mixins.styl"
  .recommend-title
    font-size :0.3rem
    line-height: 0.8rem
    background :#eee
    margin-top: .2rem
    text-indent :.2rem
  .recommend-item
    display :flex
    height :1.9rem
    overflow :hidden
    padding :.1rem .1rem
    .item-img
      width 1.7rem
      height: 1.7rem
      padding: .1rem
    .item-info
      flex :1
      min-width :0
      font-size :0.3rem
      padding: .1rem
      .item-title
        line-height: .54rem
        ellipsis()
      .item-desc
        line-height: .4rem
        ellipsis()
        color #bbb
        font-size :0.24rem
      .item-button
        background :#ff9300
        border-radius .06rem
        margin-top: .2rem
        color :#fff
        padding :.1rem .2rem
        margin-top: .16rem
        outline :none
        border :none
</style>
